@extends('admin.layout.main')
@section('content')
    <!-- Main content -->
    <section class="content">
        <!-- Small boxes (Stat box) -->
        <div class="row">
            <div class="col-lg-10 col-xs-6">
                <div class="box">

                    <!-- /.box-header -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">完善员工信息</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="/admin/users/{{$user->id}}/infostore" method="POST" enctype="multipart/form-data">
                            {{csrf_field()}}
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">用户名</label>
                                    <input type="text" class="form-control" value="{{$user->name}}" readonly>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">入职时间</label>
                                    <input type="date" class="form-control" placeholder="入职时间" name="working_age" value="{{date('Y-m-d',$user->working_age)}}">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">性别</label>
                                    <input type="radio" name="sex" value="0" 
                                        @if($user->sex == 0)
                                            checked
                                        @endif
                                    >男
                                    <input type="radio" name="sex" value="1" 
                                        @if($user->sex == 1)
                                            checked
                                        @endif
                                    >女
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">身份证号码</label>
                                    <input type="text" class="form-control" value="{{$user->id_card}}" name="id_card">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">银行卡号</label>
                                    <input type="text" class="form-control" value="{{$user->bank_card}}" name="bank_card">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">所属部门</label>
                                    <select class="form-control" name="department_id" id="department">
                                        @foreach($departments as $department)
                                            <option value="{{$department->id}}"
                                            @if($user->department_id == $department->id)
                                                selected
                                            @endif
                                            >
                                                {{$department->name}}
                                            </option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">所在岗位</label>
                                    <select class="form-control" name="job_id" id="job">
                                        @foreach($jobs as $job)
                                            <option value="{{$job->id}}"
                                            @if($user->job_id == $job->id)
                                                selected
                                            @endif
                                            >
                                                {{$job->name}}
                                            </option>
                                        @endforeach
                                    </select>
                                </div>
                                <!--<div class="form-group">
                                  <label for="exampleInputPassword1">用户头像</label>
                                  <input type="file" name="head_image">
                                  <div style="width:200px;height:200px;border-radius:50%;overflow:hidden;">
                                      <img src="/sysimg/{{$user->head_image}}" width="200px" height="200px">
                                  </div>
                                </div>-->
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                            @include('layout.error')
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
    <script type="text/javascript">
        $('#datepicker').datepicker({
          autoclose: true
        });
    </script>
    @endsection